package com.dapeis.web.wx.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import com.google.gson.JsonElement;

/**
 * 用户类 Title:IUserController.java IUserController Description:
 * 
 * @author yuanyong
 * @date 2017年4月26日 下午3:39:27 Email: hzyuanyong@126.com
 *
 */

public interface IUserController {

    /**
     * 获取用户信息
     * 
     * @param code
     * @param request
     * @return
     */
    @RequestMapping("/getUserInfo")
    public @ResponseBody JsonElement getUserInfo(@RequestParam String code,
	    HttpServletRequest request);

    /**
     * 获取JSAPI签名
     * 
     * @param request
     * @return
     */
    @RequestMapping("/getJsapiSigna")
    public @ResponseBody JsonElement JsapiSignature(@RequestParam String url,
	    HttpServletRequest request);

    /**
     * 用户绑定手机号验证
     * 
     * @param contact
     * @param verifyCode
     * @param request
     * @return
     */
    @RequestMapping(value = "/bind", method = RequestMethod.POST)
    public @ResponseBody JsonElement binding(@RequestParam String contact,
	    @RequestParam String verifyCode, HttpServletRequest request);

    /**
     * 获取用户信息 （test）
     * 
     * @param id
     * @param request
     * @return
     */
    @RequestMapping("/info")
    public @ResponseBody JsonElement getUserInfo(HttpServletRequest request);

    /**
     * 保存个人信息
     * 
     * @param sex
     *            性别
     * @param faceshpe
     *            脸型
     * @param colorofskin
     *            肤色
     * @param bodySize
     *            体型
     * @param problem
     *            解决问题
     * @param style
     *            喜好风格
     * @param heigh
     *            身高
     * @param weight
     *            体重
     * @param chest
     *            胸围
     * @param waist
     *            腰围
     * @param hip
     *            臀围
     * @param professional
     *            职业
     * @param cityCode
     *            城市
     * @param birthday
     *            生日
     * @param request
     * @return
     */
    @RequestMapping(value = "/save", method = RequestMethod.POST)
    public @ResponseBody JsonElement saveUserInfo(@RequestParam Integer sex,
	    @RequestParam String faceshpe, @RequestParam String colorofskin,
	    @RequestParam String bodySize,
	    @RequestParam(required = false) String[] problems,
	    @RequestParam(required = false) String[] style,
	    @RequestParam String heigh, @RequestParam String weight,
	    @RequestParam String chest, @RequestParam String waist,
	    @RequestParam String hip,
	    @RequestParam(required = false) String professional,
	    @RequestParam(required = false) String countyCode,
	    @RequestParam(required = false) String birthday,
	    @RequestParam(required = false) MultipartFile[] lifeImg,
	    @RequestParam(required = false) String[] lifeImgIds,
	    HttpServletRequest request);

    /**
     * 后台配置参数
     * 
     * @param request
     * @return
     */
    @RequestMapping("/config")
    public @ResponseBody JsonElement config(HttpServletRequest request);

    /**
     * 分享
     * 
     * @param userId
     * @param request
     * @return
     */
    @RequestMapping("/{userId}/share")
    public @ResponseBody JsonElement share(@PathVariable Integer userId,
	    HttpServletRequest request);

}
